﻿declare namespace Hawksoft {

    class DataGrid<TItem, TOptions> extends Widget<TOptions> {
        constructor(container: JQuery, options?: TOptions);
        protected allColumns: Slick.Column[];
        protected defaultColumns: string[];
        protected titleDiv: JQuery;
        protected filterBar: FilterDisplayBar;
        protected quickFiltersDiv: JQuery;
        protected slickContainer: JQuery;
        protected toolbar: Toolbar;
        protected addBooleanFilter(field: string, title?: string, yes?: string, no?: string): SelectEditor;
        protected booleanQuickFilter(field: string, title?: string, yes?: string, no?: string): QuickFilter<SelectEditor, SelectEditorOptions>;;
        protected addDateRangeFilter(field: string, title?: string): DateEditor;
        protected addDateTimeRangeFilter(field: string, title?: string): DateTimeEditor;
        protected dateRangeQuickFilter(field: string, title?: string): QuickFilter<DateEditor, DateTimeEditorOptions>;
        protected dateTimeRangeQuickFilter(field: string, title?: string): QuickFilter<DateTimeEditor, DateTimeEditorOptions>;
        protected addQuickFilter<TWidget extends Widget<any>, TOptions>(filter: QuickFilter<TWidget, TOptions>): TWidget;
        protected addFilterSeparator(): void;
        protected add_submitHandlers(action: () => void): void;
        protected remove_submitHandlers(action: () => void): void;
        protected bindToSlickEvents(): void;
        protected bindToViewEvents(): void;
        protected createFilterBar(): void;
        protected createIncludeDeletedButton(): void;
        protected createPager(): void;
        protected createQuickFilters(): void;
        protected createQuickSearchInput(): void;
        protected createSlickContainer(): JQuery;
        protected createSlickGrid(): Slick.Grid;
        protected createToolbar(): void;
        protected createToolbarExtensions(): void;
        protected createView(): Slick.RemoteView<TItem>;
        protected determineText(text: string, getKey: (s: string) => string): string;
        protected editItem(entityOrId: any): void;
        protected editItemOfType(itemType: string, entityOrId: any): void;
        protected enableFiltering(): boolean;
        protected findQuickFilter<TWidget>(type: { new (...args: any[]): TWidget }, field: string): TWidget
        protected getAddButtonCaption(): string;
        protected getButtons(): ToolButton[];
        protected getColumns(): Slick.Column[];
        protected getColumnsAsync(): PromiseLike<Slick.Column[]>;
        protected getColumnsKey(): string;
        protected getCurrentSettings(flags?: GridPersistanceFlags): PersistedGridSettings;
        protected getPersistanceFlags(): GridPersistanceFlags;
        protected getPersistanceStorage(): SettingStorage;
        protected getPersistanceKey(): string;
        protected persistSettings(flags?: GridPersistanceFlags): void;
        protected restoreSettings(settings?: PersistedGridSettings, flags?: GridPersistanceFlags): void;
        protected getDefaultSortBy(): string[];
        protected getGridCanLoad(): boolean;
        protected getIdProperty(): string;
        protected getIncludeColumns(include: { [key: string]: boolean }): void;
        protected getInitialTitle(): string;
        protected getIsActiveFieldName(): string;
        protected getItemCssClass(item: TItem, index: number): string;
        protected getItemMetadata(item: TItem): any;
        protected getItemType(): string;
        protected getLocalTextPrefix(): string;
        protected getPropertyItems(): PropertyItem[];
        protected getPropertyItemsAsync(): PromiseLike<PropertyItem[]>;
        protected getQuickFilters(): QuickFilter<Widget<any>, any>[];
        protected getQuickSearchFields(): QuickSearchField[];
        protected getSlickOptions(): Slick.GridOptions;
        protected getViewOptions(): Slick.RemoteViewOptions;
        protected initialPopulate(): void;
        protected initializeAsync(): PromiseLike<void>;
        protected internalRefresh(): void;
        protected invokeSubmitHandlers(): void;
        protected itemLink(itemType?: string, idField?: string, text?: (ctx: Slick.FormatterContext) => string,
            cssClass?: (ctx: Slick.FormatterContext) => string, encode?: boolean): void;
        protected layout(): void;
        protected markupReady(): void;
        protected onClick(e: JQueryEventObject, row: number, cell: number): void;
        protected onViewFilter(item: TItem): boolean;
        protected onViewProcessData(response: ListResponse<TItem>): ListResponse<TItem>;
        protected onViewSubmit(): boolean;
        protected populateLock(): void;
        protected populateUnlock(): void;
        protected populateWhenVisible(): void;
        protected postProcessColumns(columns: Slick.Column[]): Slick.Column[];
        protected propertyItemsToSlickColumns(items: PropertyItem[]): Slick.Column[];
        protected quickFilterChange(e: JQueryEventObject): void;
        protected resizeCanvas(): void;
        protected setCriteriaParameter(): void;
        protected setEquality(field: string, value: any): void;
        protected setIncludeColumnsParameter(): void;
        protected setInitialSortOrder(): void;
        protected subDialogDataChange(): void;
        protected updateDisabledState(): void;
        protected usePager(): boolean;
        public openDialogsAsPanel?: boolean;
        public refresh(): void;
        public getItems(): TItem[];
        public setItems(value: TItem[]): void;
        public isDisabled: boolean;
        public setIsDisabled(value: boolean): void;
        public getTitle(): string;
        public setTitle(value: string): void;
        public itemAt(row: number): TItem;
        public rowCount(): number;
        public view: Slick.RemoteView<TItem>;
        public slickGrid: Slick.Grid;
        public getElement(): JQuery;
        public getFilterStore(): FilterStore;
        public getGrid(): Slick.Grid;
        public getView(): Slick.RemoteView<TItem>;
        public static defaultHeaderHeight: number;
        public static defaultRowHeight: number;
        public static defaultPersistanceStorage: SettingStorage;
    }
}